<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body>
<h1>Config file</h1>
The online node configuration file is named <b>gocoin.conf</b><br>
Client application looks for this file in the folder where it is being launched from.<br>
The config file is in JSON encoded format, so the order of the fields does not matter, but their types do.<br>
<br>


<table border="1" cellspacing="0" cellpadding="5">
<tbody>
<tr style="color:blue">
<td>Filed name</td>
<td> Type</td>
<td> Default value (if not specified)</td>
<td> Description</td>
</tr>
<tr>
<td class="cfg_name"> Testnet</td>
<td class="cfg_type"> bool</td>
<td> false</td>
<td class="cfg_info"> Use testnet3 if true</td>
</tr>
<tr>
<td class="cfg_name"> ConnectOnly</td>
<td class="cfg_type"> string</td>
<td> ""</td>
<td class="cfg_info"> Connect only to this host/IP (and nowhere else)</td>
</tr>
<tr>
<td class="cfg_name"> Datadir</td>
<td class="cfg_type"> string</td>
<td>"%APPDATA%\Bitcoin\gocoin"<br>
or "~/.bitcoin/gocoin"</td>
<td class="cfg_info"> The data folder for the gocoin client node.<br>
It contains the bock chain, UTXO and peers database, plus some other files used by the client.
</tr>
<tr>
<td class="cfg_name"> UserAgent</td>
<td class="cfg_type"> string</td>
<td> ""</td>
<td class="cfg_info"> Overwrite the string reported by the node as User-Agent in the version messages.<br>
When this value is empty, the defualt of <b>/Gocoin:x.y.z/</b> is used.</td>
</tr>

<tr><td class="cfg_name"> TextUI_Enabled</td>
<td class="cfg_type"> bool</td>
<td> true</td>
<td class="cfg_info"> Enable TextUI. You will want to disable text interface if you want to start the node as a daemon (with no stdin).<br>
Note that on Linux based systems it is advised to run the node within the "screen" command, in which case you want to keep TextUI enabled.</td>
</tr>

<tr>
<td class="cfg_name"> LastTrustedBlock</td>
<td class="cfg_type"> string</td>
<td> <i>updated regularly</i></td>
<td class="cfg_info"> Hash of the highest trused block (used to speed up initial chain sync).</td>
</tr>

<tr class="even">
<td class="cfg_name"> WebUI.Interface</td>
<td class="cfg_type"> string</td>
<td> "127.0.0.1:8833"</td>
<td class="cfg_info"> Bind WebUI server to this interface. Change it to ":8833" in order to allow external connections.<br>
</td>
</tr>
<tr class="even">
<td class="cfg_name"> WebUI.AllowedIP </td>
<td class="cfg_type"> string</td>
<td> "127.0.0.1"</td>
<td class="cfg_info"> List of IP addresses that are allowed to access WebUI. Use "0.0.0.0/0" to let everyone in.</td>
</tr>
<tr class="even">
<td class="cfg_name"> WebUI.ShowBlocks</td>
<td class="cfg_type"> uint32</td>
<td> 144</td>
<td class="cfg_info"> How many recent blocks to show at the Blocks page.</td>
</tr>
<tr class="even">
<td class="cfg_name"> WebUI.AddrListLen</td>
<td class="cfg_type"> uint32</td>
<td> 15</td>
<td class="cfg_info"> How many addresses to show (at the same time) in the address book that pops up at MakeTx page.</td>
</tr>
<tr class="even">
<td class="cfg_name"> WebUI.Title </td>
<td class="cfg_type"> string</td>
<td> "Gocoin"</td>
<td class="cfg_info"> Title of the WebUI window as seen in the web browser.</td>
</tr>
<tr class="even">
<td class="cfg_name"> WebUI.PayCmdName</td>
<td class="cfg_type"> string</td>
<td> "pay_cmd.txt"</td>
<td class="cfg_info"> The file name of the pay script command inside the payment.zip (created at MakeTx page).<br>
Prefering convenience over security, change .txt extension to .bat or .sh (depending on your platform).</td>
</tr>
<tr class="even">
<td class="cfg_name"> WebUI.ServerMode </td>
<td class="cfg_type"> bool</td>
<td> false</td>
<td class="cfg_info"> Enable mode in which the WebUI operator cannot do certain things (e.g. change configuration).</td>
</tr>
<tr class="even">
    <td class="cfg_name"> WebUI.SSLPort </td>
    <td class="cfg_type"> uint16</td>
    <td> 0</td>
    <td class="cfg_info"> TCP port number to be used for SSL server.<br>
    Zero value means to use the default port, which is 4433 for main net and 14433 for test net.<br>
    Note that SSL server needs valid <code>ca.crt</code>, <code>server.crt</code> and
    <code>server.key</code> in the client's <code>ssl_cert/</code> dir.</td>
    </tr>
    
<tr class="odd">
<td class="cfg_name"> Net.ListenTCP</td>
<td class="cfg_type"> bool</td>
<td> true</td>
<td class="cfg_info"> Accept incoming TCP connections.</td>
</tr>
<tr class="odd">
<td class="cfg_name"> Net.TCPPort</td>
<td class="cfg_type"> uint16</td>
<td> 0 </td>
<td class="cfg_info"> Use this TCP port for incomming connections.<br>
    Zero value means to use the default port, which is 8333 for main net and 18333 for test net.<br>
Note that Bitcoin Core (before version 23.0) does not connect to TCP ports other than the default.</td>
</tr>
<tr class="odd">
<td class="cfg_name"> Net.BindToIF</td>
<td class="cfg_type"> string</td>
<td> "0.0.0.0" </td>
<td class="cfg_info"> Network interface to bind to, for the incomming connections from bitcoin peers. "0.0.0.0" binds to all network interfaces.</td>
</tr>
<tr class="odd">
<td class="cfg_name"> Net.MaxOutCons</td>
<td class="cfg_type"> uint32</td>
<td> 9</td>
<td class="cfg_info"> Maximum number of outgoing TCP connections.</td>
</tr>
<tr class="odd">
<td class="cfg_name"> Net.MaxInCons</td>
<td class="cfg_type"> uint32</td>
<td> 10</td>
<td class="cfg_info"> Maximum number of incoming TCP connections.</td>
</tr>
<tr class="odd">
<td class="cfg_name"> Net.MaxUpKBps</td>
<td class="cfg_type"> uint</td>
<td> 0</td>
<td class="cfg_info"> Maximum upload speed in kilobytes per second. 0 means unlimited.</td>
</tr>
<tr class="odd">
<td class="cfg_name"> Net.MaxDownKBps</td>
<td class="cfg_type"> uint</td>
<td> 0</td>
<td class="cfg_info"> Maximum download speed in kilobytes per second. 0 means unlimited. </td>
</tr>
<tr class="odd">
<td class="cfg_name"> Net.MaxBlockAtOnce</td>
<td class="cfg_type"> uint32</td>
<td> 3</td>
<td class="cfg_info"> When a new block appears, (up to) how many peers to ask for its data at the same time.</td>
</tr>
<tr class="odd">
<td class="cfg_name"> Net.MinSegwitCons</td>
<td class="cfg_type"> uint32</td>
<td> 4</td>
<td class="cfg_info"> Maintain at least so many connections to nodes indicating support for Segregated Witness (via bit 0x8 in Services).</td>
<tr class="odd">
<td class="cfg_name"> Net.ExternalIP</td>
<td class="cfg_type"> string</td>
<td> ""</td>
<td class="cfg_info"> If the string is a valid IP v4 address, it will be used as <code>addr_from</code> inside <code>version</code> messages.</td>

<tr class="even">
<td class="cfg_name"> TXPool.Enabled</td>
<td class="cfg_type"> bool</td>
<td> true</td>
<td class="cfg_info"> Enable memory pool (for transactions).</td>
</tr>
<tr class="even">
<td class="cfg_name"> TXPool.AllowMemInputs</td>
<td class="cfg_type"> bool</td>
<td> true</td>
<td class="cfg_info"> Accept transactions with unconfirmed inputs to the memory pool.</td>
</tr>
<tr class="even">
<td class="cfg_name"> TXPool.FeePerByte</td>
<td class="cfg_type"> float64</td>
<td> 1.0</td>
<td class="cfg_info"> Required minimum fee per byte to accept a transaction to the memory pool.</td>
</tr>
<tr class="even">
<td class="cfg_name"> TXPool.MaxTxSize</td>
<td class="cfg_type"> uint32</td>
<td> 100000</td>
<td class="cfg_info"> Maximum size of a transaction that would be accepted to the memory pool.</td>
</tr>
<tr class="even">
<td class="cfg_name"> TXPool.MaxSizeMB</td>
<td class="cfg_type"> uint</td>
<td> 300</td>
<td class="cfg_info"> If not zero, the node will keep the mempool size below this value.</td>
</tr>
<tr class="even">
<td class="cfg_name"> TXPool.MaxRejectMB</td>
<td class="cfg_type"> uint</td>
<td> 25</td>
<td class="cfg_info"> If not zero, the node will keep the cache of rejected transaction below this value.</td>
</tr>
<tr class="even">
<td class="cfg_name"> TXPool.MaxRejectCnt</td>
<td class="cfg_type"> uint</td>
<td> 5000</td>
<td class="cfg_info"> If not zero, the node will not keep more than this many records of rejected transaction.</td>
</tr>
<tr class="even">
<td class="cfg_name"> TXPool.SaveOnDisk</td>
<td class="cfg_type"> bool</td>
<td> true</td>
<td class="cfg_info"> Save content of memory pool to disk on closing and load it on startup.</td>
</tr>

<tr class="odd">
<td class="cfg_name"> TXRoute.Enabled</td>
<td class="cfg_type"> bool</td>
<td> true</td>
<td class="cfg_info"> Enable routing of transactions (memory pool must be enabled as well).</td>
</tr>
<tr class="odd">
<td class="cfg_name"> TXRoute.FeePerByte</td>
<td class="cfg_type"> float64</td>
<td> 0.0</td>
<td class="cfg_info"> Required minimum fee per byte to route accepted transactions.<br>
Note that transactions which do not meet "TXPool.FeePerByte" (see above) are not being accepted,
therefore setting it to 0.0 will route all the accepted transactions.</td>
</tr>
<tr class="odd">
<td class="cfg_name"> TXRoute.MaxTxSize</td>
<td class="cfg_type"> uint32</td>
<td> 100000</td>
<td class="cfg_info"> Maximum size of a transaction that will be routed to other peers.</td>
</tr>
<tr class="odd">
<td class="cfg_name"> TXRoute.MemInputs</td>
<td class="cfg_type"> bool</td>
<td> false</td>
<td class="cfg_info"> Route transactions which spend unconfirmed inputs.</td>
</tr>

<tr class="even">
<td class="cfg_name"> Memory.GCPercTrshold</td>
<td class="cfg_type"> int </td>
<td> 30</td>
<td class="cfg_info"> A threshold (in percent) to trigger Go's garbage collector engine.<br>
    The higher you set it, the better performance should be (at a cost of RAM).</td>
</tr>
<tr class="even">
<td class="cfg_name"> Memory.UseGoHeap</td>
<td class="cfg_type"> bool</td>
<td> false</td>
<td class="cfg_info"> Use native Go heap with Garbage Collector for UTXO records.<br>
Using native heap makes the node a bit faster at a cost of using more RAM, although it is not always the case.
</td>
</tr>
<tr class="even">
<td class="cfg_name"> Memory.MaxCachedBlks</td>
<td class="cfg_type"> uint</td>
<td> 200</td>
<td class="cfg_info"> How many (recently used) blocks shall be kept in RAM.</td>
</tr>
<tr class="even">
    <td class="cfg_name"> Memory.FreeAtStart</td>
    <td class="cfg_type"> bool</td>
    <td> false</td>
    <td class="cfg_info"> After loading UTXO database from disk, free as much RAM as possible.</td>
</tr>
<tr class="even">
<td class="cfg_name"> Memory.CacheOnDisk</td>
<td class="cfg_type"> bool</td>
<td> true</td>
<td class="cfg_info"> During chain sync, store bigger blocks on disk (in datadir's "tmpblk/") instead of holding them in RAM.<br>
Makes block chain sync process a bit slower, but saves RAM instead.</td>
</tr>
<tr class="even">
<td class="cfg_name"> Memory.MaxSyncCacheMB</td>
<td class="cfg_type"> uint</td>
<td> 500</td>
<td class="cfg_info"> Set the size of a cached blocks buffer, used during chain sync.</td>
</tr>
<tr class="even">
<td class="cfg_name"> Memory.MaxDataFileMB</td>
<td class="cfg_type"> uint</td>
<td> 1000</td>
<td class="cfg_info"> Maximum size of single data file in blocks database (0 for unlimited). Used for easy purging of old blocks.</td>
</tr>
<tr class="even">
<td class="cfg_name"> Memory.DataFilesKeep</td>
<td class="cfg_type"> uint32</td>
<td> 0</td>
<td class="cfg_info"> If not zero, keep only such many complete data files of the blocks database (auto purging of the old blocks).</td>
</tr>
<tr class="even">
<td class="cfg_name"> Memory.OldDataBackup</td>
<td class="cfg_type"> bool</td>
<td> false</td>
<td class="cfg_info"> Save data files to "oldat/" folder before deleting them from the blocks database.<br>
It is useful for automatic archiving old blocks on a different drive ("oldat/" shall be a link to a different drive, then).<br>
The blocks from "oldat/" folder will still be served by the node to its peers.</td>
</tr>
<tr class="even">
<td class="cfg_name"> Memory.PurgeUnspendableUTXO</td>
<td class="cfg_type"> bool</td>
<td> true</td>
<td class="cfg_info"> When enabled, the node does not store unspendable outputs in its UTXO database.<br>
Having just enabling this option, execute TextUI command <code>purge</code> to purge all unspendable records kept from past transactions.<br>
Disabling this will make your node to require more RAM, but may be necessary for certain applications that one may develop on top of Gocoin's UTXO database.<br>
</td>
</tr>
<tr class="even">
<td class="cfg_name"> Memory.CompressBlockDB</td>
<td class="cfg_type"> bool</td>
<td> true</td>
<td class="cfg_info"> Compress blocks on disk.<br>
</td>
</tr>
    
<tr class="odd">
<td class="cfg_name"> AllBalances.MinValue</td>
<td class="cfg_type"> uint</td>
<td> 10000</td>
<td class="cfg_info"> The addresses balance database does not include inputs carrying value lover than this many Satoshis.</td>
</tr>

<tr class="odd">
<td class="cfg_name"> AllBalances.UseMapCnt</td>
<td class="cfg_type"> int</td>
<td> 5000</td>
<td class="cfg_info"> Use hashmap instead of list for addresses that have this many (or more) unspent outputs.</td>
</tr>

<tr class="odd">
<td class="cfg_name"> AllBalances.AutoLoad</td>
<td class="cfg_type"> bool</td>
<td> true</td>
<td class="cfg_info"> Atomatically enable wallet functionality after the node is launched and synchronized.</td>
</tr>

<tr class="even">
<td class="cfg_name"> DropPeers.DropEachMinutes</td>
<td class="cfg_type"> uint</td>
<td> 5</td>
<td class="cfg_info"> How many minutes between disconnecting the slowest peers. 0 - never drop peers.</td>
</tr>
<tr class="even">
<td class="cfg_name"> DropPeers.BlckExpireHours</td>
<td class="cfg_type"> uint</td>
<td> 24</td>
<td class="cfg_info"> How many hours before blocks received from a peer "expire",  in slowest peer calculation.</td>
</tr>
<tr class="even">
<td class="cfg_name"> DropPeers.PingPeriodSec</td>
<td class="cfg_type"> uint</td>
<td> 15</td>
<td class="cfg_info"> How many seconds between sending ping comand to a peer. 0 - do not ping.</td>
</tr>

<tr class="odd">
<td class="cfg_name"> Stat.HashrateHrs </td>
<td class="cfg_type"> uint</td>
<td> 12</td>
<td class="cfg_info"> How many hours to look back for the hashrate calculation (the one shown on the home page of WebUI)</td>
</tr>
<tr class="odd">
<td class="cfg_name"> Stat.MiningHrs</td>
<td class="cfg_type"> uint</td>
<td> 24</td>
<td class="cfg_info"> How many hours the mining statistics (at WebUI's Miners page) should look back.</td>
</tr>
<tr class="odd">
<td class="cfg_name"> Stat.FeesBlks</td>
<td class="cfg_type"> uint</td>
<td> 24</td>
<td class="cfg_info"> How many block down the chain to look for calculating the current average transaction fee.</td>
</tr>
<tr class="odd">
<td class="cfg_name"> Stat.BSizeBlks</td>
<td class="cfg_type"> uint</td>
<td> 72</td>
<td class="cfg_info"> How many block down the chain to look for calculating the current average block size.</td>
</tr>
<tr class="odd">
<td class="cfg_name"> Stat.NoCounters</td>
<td class="cfg_type"> bool</td>
<td> false</td>
<td class="cfg_info"> When set, it turns off node's internal counters to improve performance.</td>
</tr>
    
<tr class="even">
<td class="cfg_name"> UTXOSave.BlocksToHold</td>
<td class="cfg_type"> uint</td>
<td> 6</td>
<td class="cfg_info"> Skip so many new blocks before auto saving a new UTXO.db to disk.<br>
Note that UTXO.db has a size of a few GB - saving it more often may cause a solid state drive (SSD) to deplete faster.</td>
</tr>
<tr class="even">
<td class="cfg_name"> UTXOSave.SecondsToTake</td>
<td class="cfg_type"> uint</td>
<td> 300</td>
<td class="cfg_info"> While saving UTXO.db to disk, spread (delay) the process into at least so many seconds.
New block arriving within this period will abort and restart the saving process.
0 saves UTXO.db as fast as possible.<br>
Note that setting this value too low may make your system sluggish while the database is being written.
At the other hand, setting it too high may make the saving process unable to complete for long periods of time.</td>
</tr>


</tbody>
</table>
<br>

</body>
</html>